// Fill out your copyright notice in the Description page of Project Settings.

#include "WorldRoadParts.h"
#include "WorldEntityReferencing.h"

WORLD_ENTITY_META_DEFINE(FWorldRoadSurfaceCRG, FWorldEntityPart);

FWorldRoadSurfaceCRG::FWorldRoadSurfaceCRG()
	: Super()
	, File(this, "")
	, SStart(this, 0.0)
	, SEnd(this, 0.0)
	, Orientation(this, "")
	, Mode(this, "")
	, Purpose(this, "")
	, SOffset(this, 0.0)
	, TOffset(this, 0.0)
	, ZOffset(this, 0.0)
	, ZScale(this, 0.0)
	, HOffset(this, 0.0)
{}

FWorldRoadSurfaceCRG::FWorldRoadSurfaceCRG(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, File(this, "", elem, "file")
	, SStart(this, 0.0, elem, "sStart")
	, SEnd(this, 0.0, elem, "sEnd")
	, Orientation(this, "", elem, "orientation")
	, Mode(this, "", elem, "mode")
	, Purpose(this, "", elem, "purpose")
	, SOffset(this, 0.0, elem, "sOffset")
	, TOffset(this, 0.0, elem, "tOffset")
	, ZOffset(this, 0.0, elem, "zOffset")
	, ZScale(this, 0.0, elem, "zScale")
	, HOffset(this, 0.0, elem, "hOffset")
{}

FWorldRoadSurfaceCRG::~FWorldRoadSurfaceCRG()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadSurface, FWorldEntityPart);

FWorldRoadSurface::FWorldRoadSurface()
	: Super()
	, CRG(this)
{}

FWorldRoadSurface::FWorldRoadSurface(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, CRG(this, elem, "CRG")
{}

FWorldRoadSurface::~FWorldRoadSurface()
{}

void FWorldRoadSurface::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(CRG);
}

WORLD_ENTITY_META_DEFINE(FWorldSignalReference, FWorldEntityPart);

FWorldSignalReference::FWorldSignalReference()
	: Super()
	, S(this, 0.0)
	, T(this, 0.0)
	, ID(this)
	, Orientation(this, FWorldRoadObjectOrientation::None)
	, Validity(this)
{}

FWorldSignalReference::FWorldSignalReference(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, T(this, 0.0, elem, "t")
	, ID(this, elem, "id")
	, Orientation(this, FWorldRoadObjectOrientation::None, elem, "orientation")
	, Validity(this, elem, "validity")
{}

FWorldSignalReference::~FWorldSignalReference()
{}

void FWorldSignalReference::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(ID)
		.Resolve(Validity);
}

WORLD_ENTITY_META_DEFINE(FWorldSignalProxy, FWorldEntityPart);

FWorldSignalProxy::FWorldSignalProxy()
	: Super()
	, ID(this)
{}

FWorldSignalProxy::FWorldSignalProxy(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ID(this, elem, "id")
{}

FWorldSignalProxy::~FWorldSignalProxy()
{}

void FWorldSignalProxy::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(ID);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadSignals, FWorldEntityPart);

FWorldRoadSignals::FWorldRoadSignals()
	: Super()
	, Signal(this)
	, SignalReference(this)
{}

FWorldRoadSignals::FWorldRoadSignals(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Signal(this, elem, "signal")
	, SignalReference(this, elem, "signalReference")
{}

FWorldRoadSignals::~FWorldRoadSignals()
{}

void FWorldRoadSignals::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Signal)
		.Resolve(SignalReference);
}

WORLD_ENTITY_META_DEFINE(FWorldBridgeProxy, FWorldEntityPart);

FWorldBridgeProxy::FWorldBridgeProxy()
	: Super()
	, ID(this)
{}

FWorldBridgeProxy::FWorldBridgeProxy(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ID(this, elem, "id")
{}

FWorldBridgeProxy::~FWorldBridgeProxy()
{}

void FWorldBridgeProxy::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(ID);
}

WORLD_ENTITY_META_DEFINE(FWorldTunnelProxy, FWorldEntityPart);

FWorldTunnelProxy::FWorldTunnelProxy()
	: Super()
	, ID(this)
{}

FWorldTunnelProxy::FWorldTunnelProxy(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ID(this, elem, "id")
{}

FWorldTunnelProxy::~FWorldTunnelProxy()
{}

void FWorldTunnelProxy::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(ID);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadObjectReference, FWorldEntityPart);

FWorldRoadObjectReference::FWorldRoadObjectReference()
	: Super()
	, S(this, 0.0)
	, T(this, 0.0)
	, ID(this)
	, ZOffset(this, 0.0)
	, ValidLength(this, 0.0)
	, Orientation(this, FWorldRoadObjectOrientation::None)
	, Validity(this)
{}

FWorldRoadObjectReference::FWorldRoadObjectReference(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, T(this, 0.0, elem, "t")
	, ID(this, elem, "id")
	, ZOffset(this, 0.0, elem, "zOffset")
	, ValidLength(this, 0.0, elem, "validLength")
	, Orientation(this, FWorldRoadObjectOrientation::None, elem, "orientation")
	, Validity(this, elem, "validity")
{}

FWorldRoadObjectReference::~FWorldRoadObjectReference()
{}

void FWorldRoadObjectReference::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(ID)
		.Resolve(Validity);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadObjectProxy, FWorldEntityPart);

FWorldRoadObjectProxy::FWorldRoadObjectProxy()
	: Super()
	, ID(this)
{}

FWorldRoadObjectProxy::FWorldRoadObjectProxy(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ID(this, elem, "id")
{}

FWorldRoadObjectProxy::~FWorldRoadObjectProxy()
{}

void FWorldRoadObjectProxy::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(ID);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadObjects, FWorldEntityPart);

FWorldRoadObjects::FWorldRoadObjects()
	: Super()
	, Object(this)
	, ObjectReference(this)
	, Tunnel(this)
	, Bridge(this)
{}

FWorldRoadObjects::FWorldRoadObjects(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Object(this, elem, "object")
	, ObjectReference(this, elem, "objectReference")
	, Tunnel(this, elem, "tunnel")
	, Bridge(this, elem, "bridge")
{}

FWorldRoadObjects::~FWorldRoadObjects()
{}

void FWorldRoadObjects::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Object)
		.Resolve(ObjectReference)
		.Resolve(Tunnel)
		.Resolve(Bridge);
}

WORLD_ENTITY_META_DEFINE(FWorldLaneRule, FWorldEntityPart);

FWorldLaneRule::FWorldLaneRule()
	: Super()
	, SOffset(this, 0.0)
	, Value(this, "")
{}

FWorldLaneRule::FWorldLaneRule(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Value(this, "", elem, "value")
{}

FWorldLaneRule::~FWorldLaneRule()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneHeight, FWorldEntityPart);

FWorldLaneHeight::FWorldLaneHeight()
	: Super()
	, SOffset(this, 0.0)
	, Inner(this, 0.0)
	, Outer(this, 0.0)
{}

FWorldLaneHeight::FWorldLaneHeight(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Inner(this, 0.0, elem, "inner")
	, Outer(this, 0.0, elem, "outer")
{}

FWorldLaneHeight::~FWorldLaneHeight()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneAccess, FWorldEntityPart);

FWorldLaneAccess::FWorldLaneAccess()
	: Super()
	, SOffset(this, 0.0)
	, Restriction(this, FWorldLaneRestrictionType::None)
{}

FWorldLaneAccess::FWorldLaneAccess(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Restriction(this, FWorldLaneRestrictionType::None, elem, "restriction")
{}

FWorldLaneAccess::~FWorldLaneAccess()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneSpeed, FWorldEntityPart);

FWorldLaneSpeed::FWorldLaneSpeed()
	: Super()
	, SOffset(this, 0.0)
	, Max(this, "0.0")
	, Unit(this, FWorldSpeedUnit::MPS)
{}

FWorldLaneSpeed::FWorldLaneSpeed(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Max(this, "0.0", elem, "max")
	, Unit(this, FWorldSpeedUnit::MPS, elem, "unit")
{}

FWorldLaneSpeed::~FWorldLaneSpeed()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneVisibility, FWorldEntityPart);

FWorldLaneVisibility::FWorldLaneVisibility()
	: Super()
	, SOffset(this, 0.0)
	, Forward(this, 0.0)
	, Back(this, 0.0)
	, Left(this, 0.0)
	, Right(this, 0.0)
{}

FWorldLaneVisibility::FWorldLaneVisibility(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Forward(this, 0.0, elem, "forward")
	, Back(this, 0.0, elem, "back")
	, Left(this, 0.0, elem, "left")
	, Right(this, 0.0, elem, "right")
{}

FWorldLaneVisibility::~FWorldLaneVisibility()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneMaterial, FWorldEntityPart);

FWorldLaneMaterial::FWorldLaneMaterial()
	: Super()
	, SOffset(this, 0.0)
	, Surface(this, "")
	, Friction(this, 0.0)
	, Roughness(this, 0.0)
{}

FWorldLaneMaterial::FWorldLaneMaterial(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Surface(this, "", elem, "surface")
	, Friction(this, 0.0, elem, "friction")
	, Roughness(this, 0.0, elem, "roughness")
{}

FWorldLaneMaterial::~FWorldLaneMaterial()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadMarkTypeLine, FWorldEntityPart);

FWorldRoadMarkTypeLine::FWorldRoadMarkTypeLine()
	: Super()
	, Length(this, 0.0)
	, Space(this, 0.0)
	, TOffset(this, 0.0)
	, SOffset(this, 0.0)
	, Rule(this, FWorldRoadMarkLineRule::None)
	, Width(this, 0.0)
{}

FWorldRoadMarkTypeLine::FWorldRoadMarkTypeLine(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Length(this, 0.0, elem, "length")
	, Space(this, 0.0, elem, "space")
	, TOffset(this, 0.0, elem, "tOffset")
	, SOffset(this, 0.0, elem, "sOffset")
	, Rule(this, FWorldRoadMarkLineRule::None, elem, "rule")
	, Width(this, 0.0, elem, "width")
{}

FWorldRoadMarkTypeLine::~FWorldRoadMarkTypeLine()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadMarkType, FWorldEntityPart);

FWorldRoadMarkType::FWorldRoadMarkType()
	: Super()
	, Name(this, "")
	, Width(this, 0.0)
	, Line(this)
{}

FWorldRoadMarkType::FWorldRoadMarkType(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Name(this, "", elem, "name")
	, Width(this, 0.0, elem, "width")
	, Line(this, elem, "line")
{}

FWorldRoadMarkType::~FWorldRoadMarkType()
{}

void FWorldRoadMarkType::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Line);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadMark, FWorldEntityPart);

FWorldRoadMark::FWorldRoadMark()
	: Super()
	, SOffset(this, 0.0)
	, Type(this, FWorldRoadMarkKind::None)
	, Weight(this, FWorldRoadMarkWeight::Standard)
	, Color(this, FWorldRoadMarkColor::Standard)
	, Material(this, "standard")
	, Width(this, 0.0)
	, LaneChange(this, FWorldLaneChange::Both)
	, Height(this, 0.0)
	, TypeDef(this)
{}

FWorldRoadMark::FWorldRoadMark(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, Type(this, FWorldRoadMarkKind::None, elem, "type")
	, Weight(this, FWorldRoadMarkWeight::Standard, elem, "weight")
	, Color(this, FWorldRoadMarkColor::Standard, elem, "color")
	, Material(this, "standard", elem, "material")
	, Width(this, 0.0, elem, "width")
	, LaneChange(this, FWorldLaneChange::Both, elem, "laneChange")
	, Height(this, 0.0, elem, "height")
	, TypeDef(this, elem, "type")
{}

FWorldRoadMark::~FWorldRoadMark()
{}

void FWorldRoadMark::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(TypeDef);
}

WORLD_ENTITY_META_DEFINE(FWorldLaneBorder, FWorldEntityPart);

FWorldLaneBorder::FWorldLaneBorder()
	: Super()
	, SOffset(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldLaneBorder::FWorldLaneBorder(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldLaneBorder::~FWorldLaneBorder()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneWidth, FWorldEntityPart);

FWorldLaneWidth::FWorldLaneWidth()
	: Super()
	, SOffset(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldLaneWidth::FWorldLaneWidth(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, SOffset(this, 0.0, elem, "sOffset")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldLaneWidth::~FWorldLaneWidth()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneConnector, FWorldEntityPart);

FWorldLaneConnector::FWorldLaneConnector()
	: Super()
	, ID(this, 0)
{}

FWorldLaneConnector::FWorldLaneConnector(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ID(this, 0, elem, "id")
{}

FWorldLaneConnector::~FWorldLaneConnector()
{}

WORLD_ENTITY_META_DEFINE(FWorldLaneLink, FWorldEntityPart);

FWorldLaneLink::FWorldLaneLink()
	: Super()
	, Predecessor(this)
	, Successor(this)
{}

FWorldLaneLink::FWorldLaneLink(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Predecessor(this, elem, "predecessor")
	, Successor(this, elem, "successor")
{}

FWorldLaneLink::~FWorldLaneLink()
{}

void FWorldLaneLink::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Predecessor)
		.Resolve(Successor);
}

WORLD_ENTITY_META_DEFINE(FWorldLane, FWorldEntityPart);

FWorldLane::FWorldLane()
	: Super()
	, ID(this, 0)
	, Type(this, FWorldLaneType::None)
	, Level(this, "false")
	, Link(this)
	, Width(this)
	, Border(this)
	, RoadMark(this)
	, Material(this)
	, Visibility(this)
	, Speed(this)
	, Access(this)
	, Height(this)
{}

FWorldLane::FWorldLane(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ID(this, 0, elem, "id")
	, Type(this, FWorldLaneType::None, elem, "type")
	, Level(this, "false", elem, "level")
	, Link(this, elem, "link")
	, Width(this, elem, "width")
	, Border(this, elem, "border")
	, RoadMark(this, elem, "roadMark")
	, Material(this, elem, "material")
	, Visibility(this, elem, "visibility")
	, Speed(this, elem, "speed")
	, Access(this, elem, "access")
	, Height(this, elem, "height")
{}

FWorldLane::~FWorldLane()
{}

void FWorldLane::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Link)
		.Resolve(Width)
		.Resolve(Border)
		.Resolve(RoadMark)
		.Resolve(Material)
		.Resolve(Visibility)
		.Resolve(Speed)
		.Resolve(Access)
		.Resolve(Height);
}

WORLD_ENTITY_META_DEFINE(FWorldLaneGroup, FWorldEntityPart);

FWorldLaneGroup::FWorldLaneGroup()
	: Super()
	, Lane(this)
{}

FWorldLaneGroup::FWorldLaneGroup(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Lane(this, elem, "lane")
{}

FWorldLaneGroup::~FWorldLaneGroup()
{}

void FWorldLaneGroup::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Lane);
}

WORLD_ENTITY_META_DEFINE(FWorldLaneSection, FWorldEntityPart);

FWorldLaneSection::FWorldLaneSection()
	: Super()
	, S(this, 0.0)
	, SingleSide(this, "false")
	, Left(this)
	, Center(this)
	, Right(this)
{}

FWorldLaneSection::FWorldLaneSection(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, SingleSide(this, "false", elem, "singleSide")
	, Left(this, elem, "left")
	, Center(this, elem, "center")
	, Right(this, elem, "right")
{}

FWorldLaneSection::~FWorldLaneSection()
{}

void FWorldLaneSection::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Left)
		.Resolve(Center)
		.Resolve(Right);
}

WORLD_ENTITY_META_DEFINE(FWorldLaneOffset, FWorldEntityPart);

FWorldLaneOffset::FWorldLaneOffset()
	: Super()
	, S(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldLaneOffset::FWorldLaneOffset(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldLaneOffset::~FWorldLaneOffset()
{}

WORLD_ENTITY_META_DEFINE(FWorldLanes, FWorldEntityPart);

FWorldLanes::FWorldLanes()
	: Super()
	, LaneOffset(this)
	, LaneSection(this)
{}

FWorldLanes::FWorldLanes(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, LaneOffset(this, elem, "laneOffset")
	, LaneSection(this, elem, "laneSection")
{}

FWorldLanes::~FWorldLanes()
{}

void FWorldLanes::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(LaneOffset)
		.Resolve(LaneSection);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadShape, FWorldEntityPart);

FWorldRoadShape::FWorldRoadShape()
	: Super()
	, S(this, 0.0)
	, T(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldRoadShape::FWorldRoadShape(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, T(this, 0.0, elem, "t")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldRoadShape::~FWorldRoadShape()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadCrossfall, FWorldEntityPart);

FWorldRoadCrossfall::FWorldRoadCrossfall()
	: Super()
	, Side(this, FWorldCrossfallSide::Both)
	, S(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldRoadCrossfall::FWorldRoadCrossfall(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Side(this, FWorldCrossfallSide::Both, elem, "side")
	, S(this, 0.0, elem, "s")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldRoadCrossfall::~FWorldRoadCrossfall()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadSuperelevation, FWorldEntityPart);

FWorldRoadSuperelevation::FWorldRoadSuperelevation()
	: Super()
	, S(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldRoadSuperelevation::FWorldRoadSuperelevation(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldRoadSuperelevation::~FWorldRoadSuperelevation()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadLateralProfile, FWorldEntityPart);

FWorldRoadLateralProfile::FWorldRoadLateralProfile()
	: Super()
	, Superelevation(this)
	, Crossfall(this)
	, Shape(this)
{}

FWorldRoadLateralProfile::FWorldRoadLateralProfile(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Superelevation(this, elem, "superelevation")
	, Crossfall(this, elem, "crossfall")
	, Shape(this, elem, "shape")
{}

FWorldRoadLateralProfile::~FWorldRoadLateralProfile()
{}

void FWorldRoadLateralProfile::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Superelevation)
		.Resolve(Crossfall)
		.Resolve(Shape);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadElevation, FWorldEntityPart);

FWorldRoadElevation::FWorldRoadElevation()
	: Super()
	, S(this, 0.0)
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldRoadElevation::FWorldRoadElevation(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldRoadElevation::~FWorldRoadElevation()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadElevationProfile, FWorldEntityPart);

FWorldRoadElevationProfile::FWorldRoadElevationProfile()
	: Super()
	, Elevation(this)
{}

FWorldRoadElevationProfile::FWorldRoadElevationProfile(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Elevation(this, elem, "elevation")
{}

FWorldRoadElevationProfile::~FWorldRoadElevationProfile()
{}

void FWorldRoadElevationProfile::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Elevation);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometryBase, FWorldEntityPart);

FWorldRoadGeometryBase::FWorldRoadGeometryBase()
	: Super()
{}

FWorldRoadGeometryBase::FWorldRoadGeometryBase(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
{}

FWorldRoadGeometryBase::~FWorldRoadGeometryBase()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometryPPoly3, FWorldRoadGeometryBase);

FWorldRoadGeometryPPoly3::FWorldRoadGeometryPPoly3()
	: Super()
	, Au(this, 0.0)
	, Bu(this, 0.0)
	, Cu(this, 0.0)
	, Du(this, 0.0)
	, Av(this, 0.0)
	, Bv(this, 0.0)
	, Cv(this, 0.0)
	, Dv(this, 0.0)
	, Prange(this, FWorldPPolyParameterRange::Normalized)
{}

FWorldRoadGeometryPPoly3::FWorldRoadGeometryPPoly3(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Au(this, 0.0, elem, "aU")
	, Bu(this, 0.0, elem, "bU")
	, Cu(this, 0.0, elem, "cU")
	, Du(this, 0.0, elem, "dU")
	, Av(this, 0.0, elem, "aV")
	, Bv(this, 0.0, elem, "bV")
	, Cv(this, 0.0, elem, "cV")
	, Dv(this, 0.0, elem, "dV")
	, Prange(this, FWorldPPolyParameterRange::Normalized, elem, "pRange")
{}

FWorldRoadGeometryPPoly3::~FWorldRoadGeometryPPoly3()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometryPoly3, FWorldRoadGeometryBase);

FWorldRoadGeometryPoly3::FWorldRoadGeometryPoly3()
	: Super()
	, A(this, 0.0)
	, B(this, 0.0)
	, C(this, 0.0)
	, D(this, 0.0)
{}

FWorldRoadGeometryPoly3::FWorldRoadGeometryPoly3(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, A(this, 0.0, elem, "a")
	, B(this, 0.0, elem, "b")
	, C(this, 0.0, elem, "c")
	, D(this, 0.0, elem, "d")
{}

FWorldRoadGeometryPoly3::~FWorldRoadGeometryPoly3()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometrySpiral, FWorldRoadGeometryBase);

FWorldRoadGeometrySpiral::FWorldRoadGeometrySpiral()
	: Super()
	, CurvStart(this, 0.0)
	, CurvEnd(this, 0.0)
{}

FWorldRoadGeometrySpiral::FWorldRoadGeometrySpiral(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, CurvStart(this, 0.0, elem, "curvStart")
	, CurvEnd(this, 0.0, elem, "curvEnd")
{}

FWorldRoadGeometrySpiral::~FWorldRoadGeometrySpiral()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometryArc, FWorldRoadGeometryBase);

FWorldRoadGeometryArc::FWorldRoadGeometryArc()
	: Super()
	, Curvature(this, 0.0)
{}

FWorldRoadGeometryArc::FWorldRoadGeometryArc(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Curvature(this, 0.0, elem, "curvature")
{}

FWorldRoadGeometryArc::~FWorldRoadGeometryArc()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometryLine, FWorldRoadGeometryBase);

FWorldRoadGeometryLine::FWorldRoadGeometryLine()
	: Super()
{}

FWorldRoadGeometryLine::FWorldRoadGeometryLine(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
{}

FWorldRoadGeometryLine::~FWorldRoadGeometryLine()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadGeometry, FWorldEntityPart);

FWorldRoadGeometry::FWorldRoadGeometry()
	: Super()
	, S(this, 0.0)
	, X(this, 0.0)
	, Y(this, 0.0)
	, Hdg(this, 0.0)
	, Length(this, 0.0)
	, Variant(this)
{}

FWorldRoadGeometry::FWorldRoadGeometry(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, X(this, 0.0, elem, "x")
	, Y(this, 0.0, elem, "y")
	, Hdg(this, 0.0, elem, "hdg")
	, Length(this, 0.0, elem, "length")
	, Variant(this, VariantFromXml(parent, elem))
{}

FWorldRoadGeometry::~FWorldRoadGeometry()
{}

void FWorldRoadGeometry::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Variant);
}

FWorldRoadGeometryBase::Ptr FWorldRoadGeometry::VariantFromXml(FWorldEntityPart* parent, const pugi::xml_node& elem)
{
	pugi::xml_node elemchild;

    elemchild = elem.child("line");
	if (elemchild)
		return std::make_shared<FWorldRoadGeometryLine>(parent, elemchild);	
    elemchild = elem.child("spiral");
	if (elemchild)
		return std::make_shared<FWorldRoadGeometrySpiral>(parent, elemchild);
    elemchild = elem.child("arc");
	if (elemchild)
		return std::make_shared<FWorldRoadGeometryArc>(parent, elemchild);
    elemchild = elem.child("poly3");
	if (elemchild)
		return std::make_shared<FWorldRoadGeometryPoly3>(parent, elemchild);
    elemchild = elem.child("paramPoly3");
	if (elemchild)
		return std::make_shared<FWorldRoadGeometryPPoly3>(parent, elemchild);

	return nullptr;
}

WORLD_ENTITY_META_DEFINE(FWorldPlanView, FWorldEntityPart);

FWorldPlanView::FWorldPlanView()
	: Super()
	, Geometry(this)
{}

FWorldPlanView::FWorldPlanView(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Geometry(this, elem, "geometry")
{}

FWorldPlanView::~FWorldPlanView()
{}

void FWorldPlanView::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Geometry);
}

WORLD_ENTITY_META_DEFINE(FWorldRoadSpeed, FWorldEntityPart);

FWorldRoadSpeed::FWorldRoadSpeed()
	: Super()
	, Max(this, "no limit")
	, Unit(this, FWorldSpeedUnit::MPS)
{}

FWorldRoadSpeed::FWorldRoadSpeed(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Max(this, "no limit", elem, "max")
	, Unit(this, FWorldSpeedUnit::MPS, elem, "unit")
{}

FWorldRoadSpeed::~FWorldRoadSpeed()
{}

WORLD_ENTITY_META_DEFINE(FWorldRoadType, FWorldEntityPart);

FWorldRoadType::FWorldRoadType()
	: Super()
	, S(this, 0.0)
	, Type(this, FWorldRoadKind::Unknown)
	, Speed(this)
{}

FWorldRoadType::FWorldRoadType(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, S(this, 0.0, elem, "s")
	, Type(this, FWorldRoadKind::Unknown, elem, "type")
	, Speed(this, elem, "speed")
{}

FWorldRoadType::~FWorldRoadType()
{}

void FWorldRoadType::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Speed);
}

WORLD_ENTITY_META_DEFINE(FWorldConnector, FWorldEntityPart);

FWorldConnector::FWorldConnector()
	: Super()
	, ElementType(this, "")
	, ElementId(this)
	, ContactPoint(this, FWorldContactPoint::Start)
{}

FWorldConnector::FWorldConnector(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, ElementType(this, "", elem, "elementType")
	, ElementId(this, elem, "elementId")
	, ContactPoint(this, FWorldContactPoint::Start, elem, "contactPoint")
{}

FWorldConnector::~FWorldConnector()
{}

void FWorldConnector::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	if (ElementType == "road")
	{
		referencing
			.Resolve<FWorldRoad>(ElementId);
	}
	else if (ElementType == "junction")
	{
		referencing
			.Resolve<FWorldJunction>(ElementId);
	}
}

WORLD_ENTITY_META_DEFINE(FWorldRoadLink, FWorldEntityPart);

FWorldRoadLink::FWorldRoadLink()
	: Super()
	, Predecessor(this)
	, Successor(this)
{}

FWorldRoadLink::FWorldRoadLink(FWorldEntityPart* parent, const pugi::xml_node& elem)
	: Super(parent, elem)
	, Predecessor(this, elem, "predecessor")
	, Successor(this, elem, "successor")
{}

FWorldRoadLink::~FWorldRoadLink()
{}

void FWorldRoadLink::Resolve(FWorldEntityReferencing& referencing)
{
	Super::Resolve(referencing);
	referencing
		.Resolve(Predecessor)
		.Resolve(Successor);
}
